package com.mpush.api.chat;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 聊天消息
 *
 * @author gary.zhi
 * @date Jul 19, 2018 5:08:33 PM
 */
public class ChatMessageDto {

    private Long id;
    /**
     * 会话id
     */
    private Long sessionId;

    /**
     * 发送者用户id
     */
    private String senderId;

    /**
     * 发送者姓名
     */
    private String senderName;

    /**
     * 接收者用户id
     */
    private String receiverId;

    /**
     * 接收者姓名
     */
    private String receiverName;

    /**
     * 消息类型(0=文本，1=图片，2=语音，3=视频，4=定位)
     */
    private String type;

    /**
     * 消息
     */
    private String msgContent;

    /**
     * 发送状态(0=未发送，1=发送成功，2=发送失败)
     */
    private Integer sendStatue;

    /**
     * 接收状态（0=未接收，1=已接收）
     */
    private Integer receiveStatus;
    /**
     * 发送时间
     */
    private String sendTime;
    /**
     * 接收时间
     */
    private String receiveTime;

    private Integer duration;

    public Long getSessionId() {
        return sessionId;
    }

    public void setSessionId(Long sessionId) {
        this.sessionId = sessionId;
    }

    public String getSenderId() {
        return senderId;
    }

    public void setSenderId(String senderId) {
        this.senderId = senderId;
    }

    public String getSenderName() {
        return senderName;
    }

    public void setSenderName(String senderName) {
        this.senderName = senderName;
    }

    public String getReceiverId() {
        return receiverId;
    }

    public void setReceiverId(String receiverId) {
        this.receiverId = receiverId;
    }

    public String getReceiverName() {
        return receiverName;
    }

    public void setReceiverName(String receiverName) {
        this.receiverName = receiverName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getMsgContent() {
        return msgContent;
    }

    public void setMsgContent(String msgContent) {
        this.msgContent = msgContent;
    }

    public Integer getSendStatue() {
        return sendStatue;
    }

    public void setSendStatue(Integer sendStatue) {
        this.sendStatue = sendStatue;
    }

    public Integer getReceiveStatus() {
        return receiveStatus;
    }

    public void setReceiveStatus(Integer receiveStatus) {
        this.receiveStatus = receiveStatus;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSendTime() {
        return sendTime;
    }

    public void setSendTime(String sendTime) {
        this.sendTime = sendTime;
    }

    public String getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(String receiveTime) {
        this.receiveTime = receiveTime;
    }

    public Integer getDuration() {
        return duration;
    }

    public void setDuration(Integer duration) {
        this.duration = duration;
    }

    public Map<String, String> toParam() {

        Map<String, String> param = new HashMap<>(0);

        if (null != id) {
            param.put("id", id.toString());
        }
        param.put("sessionId", null != sessionId ? sessionId.toString() : "");
        param.put("senderId", null != senderId ? senderId : "");
        param.put("senderName", null != senderName ? senderName : "");
        param.put("receiverId", null != receiverId ? receiverId : "");
        param.put("receiverName", null != receiverName ? receiverName : "");
        param.put("type", null != type ? type : "");
        param.put("msgContent", null != msgContent ? msgContent : "");
        param.put("sendStatue", null != sendStatue ? sendStatue.toString() : "0");
        param.put("receiveStatus", null != receiveStatus ? receiveStatus.toString() : "0");

        if (null != sendTime && !"".equals(sendTime.trim())) {
            param.put("sendTime", sendTime);
        }
        if (null != receiveTime && !"".equals(receiveTime.trim())) {
            param.put("receiveTime", receiveTime);
        }

        if (null != duration) {
            param.put("duration", duration.toString());
        }

        return param;
    }



}
